Name | Type | Length | IsNullable | Collation |
CategoryName | nvarchar | 30 | SQL_Latin1_General_CP1_CI_AS | |
CategoryName | sysname | 30 | SQL_Latin1_General_CP1_CI_AS | |
ProductName | nvarchar | 80 | SQL_Latin1_General_CP1_CI_AS | |
ProductName | sysname | 80 | SQL_Latin1_General_CP1_CI_AS | |
ProductSales | money | 8 |
create view "Product Sales for 1997" AS
SELECT Categories.CategoryName, Products.ProductName,
Sum(CONVERT(money,("Order Details".UnitPrice*Quantity*(1-Discount)/100))*100) AS ProductSales
FROM (Categories INNER JOIN Products ON Categories.CategoryID = Products.CategoryID)
INNER JOIN (Orders
INNER JOIN "Order Details" ON Orders.OrderID = "Order Details".OrderID)
ON Products.ProductID = "Order Details".ProductID
WHERE (((Orders.ShippedDate) Between '19970101' And '19971231'))
GROUP BY Categories.CategoryName, Products.ProductName